//
//  ChooseExpressViewController.m
//  atXiaoGeBClient
//
//  Created by Linyu Niu on 19/04/2018.
//  Copyright © 2018 Linyu Niu. All rights reserved.
//

#import "ChooseExpressViewController.h"

@interface ChooseExpressViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UITableView * listTableView;
    NSArray * dataList;
}
@end

@implementation ChooseExpressViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    __weak ChooseExpressViewController * weakSelf = self;
    UIView * navView = [[CTMediator sharedInstance] navgationHeadViewInTargetView:self.view params:[NSDictionary dictionaryWithObjectsAndKeys:@"选择所在的快递公司",@"title", nil] leftAction:^(UIButton * sender){
        [weakSelf.navigationController popViewControllerAnimated:YES];
    } rightAction:nil];
    
    listTableView = [self addTableViewInView:self.view frame:CGRectMake(0, navView.frame.origin.y + navView.frame.size.height, self.view.frame.size.width, self.view.frame.size.height - (navView.frame.origin.y + navView.frame.size.height)) delegateAndDataSource:self];
    listTableView.rowHeight = 50;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
#if kDevelopment
    return 10;
#endif
    return [dataList count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ElementTableViewCell * cell = [[ElementTableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    
    UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake(0, tableView.rowHeight - 1.0, tableView.frame.size.width, 1.0)];
    lineView.backgroundColor = [UIColor colorWithRed:77.0 / 255.0 green:94.0 / 255.0 blue:107.0 / 255.0 alpha:1.0];
    [cell addSubview:lineView];
    
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return tableView.rowHeight;
}

@end
